from django.urls import path
from .views import (
    GlobalStockSettingsView, StockAlertListView, StockAlertResolveView,
    StockMovementListView, StockMovementCreateView,
    SupplierListView, SupplierDetailView,
    PurchaseOrderListView, PurchaseOrderDetailView,
    PurchaseOrderCreateView, PurchaseOrderReceiveView,
    stock_report, supplier_report, low_stock_alerts,
    generate_stock_alerts
)

urlpatterns = [
    path('stock-settings/', GlobalStockSettingsView.as_view(), name='stock-settings'),
    path('stock-alerts/', StockAlertListView.as_view(), name='stock-alert-list'),
    path('stock-alerts/<int:pk>/resolve/', StockAlertResolveView.as_view(), name='stock-alert-resolve'),
    
    path('stock-movements/', StockMovementListView.as_view(), name='stock-movement-list'),
    path('stock-movements/create/', StockMovementCreateView.as_view(), name='stock-movement-create'),
    
    path('suppliers/', SupplierListView.as_view(), name='supplier-list'),
    path('suppliers/<int:pk>/', SupplierDetailView.as_view(), name='supplier-detail'),
    
    path('purchase-orders/', PurchaseOrderListView.as_view(), name='purchase-order-list'),
    path('purchase-orders/create/', PurchaseOrderCreateView.as_view(), name='purchase-order-create'),
    path('purchase-orders/<int:pk>/', PurchaseOrderDetailView.as_view(), name='purchase-order-detail'),
    path('purchase-orders/<int:pk>/receive/', PurchaseOrderReceiveView.as_view(), name='purchase-order-receive'),
    
    path('reports/stock/', stock_report, name='stock-report'),
    path('reports/suppliers/', supplier_report, name='supplier-report'),
    path('reports/low-stock/', low_stock_alerts, name='low-stock-alerts'),
    path('generate-stock-alerts/', generate_stock_alerts, name='generate-stock-alerts'),
]
